//
//  MDFBaseViewController.m
//  LotteryTicket
//
//  Created by tanxiaokang on 2018/4/1916.
//  Copyright © 2018年 runze. All rights reserved.
//

#import "MDFBaseViewController.h"

@interface MDFBaseViewController ()

@end

@implementation MDFBaseViewController


#pragma mark - LifeCycle
- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    self.navigationController.navigationBar.hidden = YES;
    
    self.view.backgroundColor = [UIColor whiteColor];
    [self setupNavBar];
}

- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];
    
    [self configNavigationAndTabBar];
}

#pragma mark - CustomNavBar
- (void)setupNavBar {
    
    [self.view addSubview:self.customNavBar];
    
    // 设置自定义导航栏背景图片
    //    self.customNavBar.barBackgroundImage = [UIImage imageNamed:@"userTableViewHeadBackGround"];
    self.customNavBar.barBackgroundColor = MAIN_COLOR;
    // 设置自定义导航栏标题颜色
    self.customNavBar.titleLabelColor = [UIColor whiteColor];
    
    self.customNavBar.tintColor = [UIColor whiteColor];
    
    if (self.navigationController.childViewControllers.count != 1) {
        [self.customNavBar ary_setLeftButtonWithImage:[UIImage imageNamed:@"backArrow"]];
    }
    
    [self configNavigationAndTabBar];
}

- (ARYCustomNavigationBar *)customNavBar {
    
    if (_customNavBar == nil) {
        _customNavBar = [ARYCustomNavigationBar CustomNavigationBar];
    }
    return _customNavBar;
}

#pragma mark configNavigationAndTabBar
- (void)configNavigationAndTabBar {
    
    //    NSArray <NSString *>*vcs = @[NSStringFromClass([NSObject class]),
    //                                 NSStringFromClass([NSObject class]),
    //                                 NSStringFromClass([NSObject class]),
    //                                 NSStringFromClass([NSObject class]),
    //                                 NSStringFromClass([NSObject class])];
    //
    //    [vcs enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
    //
    //        if ([NSStringFromClass([self class]) isEqual:obj]) {
    //
    //            [self.customNavBar setHidden:YES];
    //            [self.tabBarController.tabBar setHidden:ARYTabBarHidesBottomBarWhenPushed];
    //            *stop = YES;
    //        }
    //    }];
}


@end
